<!DOCTYPE html>

<?php

require_once ('conn.php');
require_once ('top.php');
if($_SESSION['role']==2){
      Header("Location:supply_index.php"); 
   }elseif($_SESSION['role']==3){
           Header("Location:dotlistMaster.php"); 
   }


?>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>优易购</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no">
    <link rel="stylesheet" type="text/css" href="css/style.css">
    <script src="js/jquery-1.11.0.min.js"></script>
</head>

<body>
    <div class="top">
        <span>新增网点</span>
    </div>

   
   
   <div class="w88">
      <form action="">
       <div class="inputtitle">网点编号：</div>
       <input class="" name="number" type="text" id="number" >
       <div class="inputtitle">网点名称：</div>
       <input class="" name="name" type="text" id="name">
       <div class="inputtitle">网点类别：</div>
       <select name="cCategory" id="cCategory">
          <option value ="">请选择类别</option>
          <?php
            $result=mysql_query("select * from ci_category where typeNumber='customertype' and isDelete=0 "); 
            $i=0;
            while($row=mysql_fetch_array($result)) 
            {


           ?>
           
          <option value ="<?=$row['id']?>"><?=$row['name']?></option>
         
          <?php
             $i++;
            }
           ?>
       </select>
       <div class="inputtitle" >备注：</div>
       <textarea rows="5" name="remark"></textarea>
       <input type=button value="确定" class="tijiao">
       </form>
    </div>
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
    <div style=" width:100%;height:100px; float:left;"></div>
    <div class="foot">
        <a href="index.php">
        <div>
        <img src="img/f11.png" alt="">
        <p>首页数据</p>
        </div>
        </a>
        
        <a href="market.php">
        <div>
        <img src="img/f22.png" alt="">
        <p>全部网点</p>
        </div>
        </a>
        
        <a href="#">
        <div>
        <img src="img/f33.png" alt="">
        <p>补货记录</p>
        </div>
        </a>
    </div>
</body>
<script src="js/outlogin.js"></script>
<script>
$(".tijiao").click(function(){
 
  
  var number =$("#number").val();
  if(number==""){
            alert('请输入网点编号');
            $("#number").focus();
            return false;
  }
  var name =  $("#name").val();
  if(name==""){
            alert('请输入网点名字');
            $("#name").focus();
            return false;
  } 
  var cCategoryname = $("#cCategory").find("option:selected").text();
  var cCategory = $("#cCategory").val();
   if(cCategory==""){
            alert('请选择网点类别');
            $("#cCategory").focus();
            return false;
  } 
  var remark =$("#remark").val();
  $.post("ajaxnewwd.php",{name:name,number:number,cCategory:cCategory,cCategoryname:cCategoryname,remark:remark},function(data) {
  if(data=="y"){
      alert('已提交申请');
      $(location).attr('href','market.php');
  }						
 });
});

</script>
</html>